package com.summer.shopping.controller;

import com.summer.shopping.domain.common.req.ReqHolder;
import com.summer.shopping.domain.dto.PageDto;
import com.summer.shopping.domain.table.Quan;
import com.summer.shopping.domain.vo.QuanVOComposite;
import com.summer.shopping.service.BagService;
import com.summer.shopping.service.QuanService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/bag")
@CrossOrigin("*")
public class BagController {

    @Autowired
    BagService bagService;

    @PostMapping("my/quan")
    public QuanVOComposite getMyQuan(@RequestBody PageDto page){
        return bagService.getMyQuan(ReqHolder.getUserId(),page);
    }

//    @GetMapping("1")
//    public QuanVOComposite getMyQuan1(){
//        PageDto page = new PageDto();
//        page.setPageNum(1);
//        page.setPageSize(10);
//        return bagService.getMyQuan(0L,page);
//    }





}
